package com.objetdirect.gwt.umldrawer.shared.dto;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

@Entity
@Table (name = "NOTIFICATIONS")
public class NotificationsDto implements Serializable {

	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue
	@Column (name = "notification_id", nullable = false, unique = true)
	private long notificationId ;
	
	@Column (name = "notification_content", nullable = false)
	private String notificationContent ;
	
	@Temporal (TemporalType.DATE)
	@Column (name = "notification_date", nullable = false)
	private Date notificationDate ;
	
	@Temporal (TemporalType.TIME)
	@Column (name = "notification_time", nullable = false)
	private Date notificationTime ;
	
	@Column (name = "notification_is_read", nullable = false)
	private int notificationIsRead ;

	@ManyToOne (fetch = FetchType.LAZY, targetEntity = ProjectDto.class)
	@JoinColumn (name = "project_id")
	private ProjectDto projectId;
	
	public NotificationsDto() {
	}
	
	public NotificationsDto(long notificationId) {
		this.notificationId = notificationId ;
	}

	public NotificationsDto(String notificationContent, Date notificationDate,
			Date notificationTime, int notificationIsRead, ProjectDto projectId) {
		super();
		this.notificationContent = notificationContent;
		this.notificationDate = notificationDate;
		this.notificationTime = notificationTime;
		this.notificationIsRead = notificationIsRead;
		this.projectId = projectId;
	}

	public NotificationsDto(long notificationId, String notificationContent,
			Date notificationDate, Date notificationTime,
			int notificationIsRead) {
		super();
		this.notificationId = notificationId;
		this.notificationContent = notificationContent;
		this.notificationDate = notificationDate;
		this.notificationTime = notificationTime;
		this.notificationIsRead = notificationIsRead;
	}

	public long getnotificationId() {
		return notificationId;
	}

	public void setnotificationId(long notificationId) {
		this.notificationId = notificationId;
	}

	public String getNotificationContent() {
		return notificationContent;
	}

	public void setNotificationContent(String notificationContent) {
		this.notificationContent = notificationContent;
	}

	public Date getNotificationDate() {
		return notificationDate;
	}

	public void setNotificationDate(Date notificationDate) {
		this.notificationDate = notificationDate;
	}

	public Date getNotificationTime() {
		return notificationTime;
	}

	public void setNotificationTime(Date notificationTime) {
		this.notificationTime = notificationTime;
	}

	public int isNotificationIsRead() {
		return notificationIsRead;
	}

	public void setNotificationIsRead(int notificationIsRead) {
		this.notificationIsRead = notificationIsRead;
	}

	public void setProjectId(ProjectDto projectId) {
		this.projectId = projectId;
	}

	public ProjectDto getProjectId() {
		return projectId;
	}
}
